<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="<?php echo __PUBLIC__?>/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="<?php echo __PUBLIC__?>/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="<?php echo __PUBLIC__?>/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="<?php echo __PUBLIC__?>/Admin/Flat/img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	</head>
	<body>
		<table class="table table-hover">
			<tr class="active">
			  <th width="90">货品id</th>
			  <?php foreach ($spec as $v){?>
			   <th><?php echo $v['taname']?></th>
			  <?php }?>
			  <th>库存</th>
			  <th>货号</th>
			  <th width="200">操作</th>
			</tr>
			<?php foreach ($data as $v){?>
			<tr>
				<td><?php echo $v['glid']?></td>
				<?php foreach ($v['spec'] as $s){?>
				   <td><?php echo $s['gavalue']?></td>
				  <?php }?>
				<td><?php echo $v['glartno']?></td>
				<td><?php echo $v['glstock']?></td>
				<td>
					<a href="<?php echo U('edit',array('glid'=>$v['glid']))?>" class="btn btn-sm btn-warning">编辑</a>
					<a href="javascript:;" class="btn btn-sm btn-danger" onclick="if(confirm('确定删除吗')) location.href='<?php echo U('del',array('glid'=>$v['glid']))?>'">删除</a>
				</td>
			</tr>
			<?php }?>
			<form action="<?php echo U('GoodsList/add')?>" method="post">
			<tr class="info">
				<td>添加货品</td>
				 <?php foreach ($spec as $v){?>
					<td>
						<select name="gltid[]">
							<option value="0">-请选择-</option>
							 <?php foreach ($v['opt'] as $s){?>
								<option value="<?php echo $s['gaid']?>"><?php echo $s['gavalue']?></option>
							<?php }?>
						</select>
					</td>
				 <?php }?>
				<td>
					<input type="text" name='glstock'/>
				</td>
				<td>
					<input type="text" name='glartno' value="" />
					<input type="hidden" name='goods_gid' value="<?php echo $gid?>" />
				</td>
				<td>
					<input type="submit" value='保存添加' class="btn btn-sm btn-warning"/>
				</td>
			</tr>
			</form>
			</table>

		</table>
	</body>
</html>
